#ifndef CIRCLEENTITY_H
#define CIRCLEENTITY_H

#include "Common/Common.h"
#include "EditorCore/IProvider.h"
#include "EditorCore/Entity.h"

class BodyEntity;

class CircleEntity : public editor_core::Entity, public editor_core::IProvider<CircleEntity*>
{
public:
	CircleEntity( BodyEntity* parentBody, const cmn::Circle& circle );
	virtual ~CircleEntity();

	inline cmn::Circle GetCircle() const { return m_circle; }
	inline void SetCircle( const cmn::Circle& circle ) { m_circle = circle; }

	virtual inline CircleEntity* GetEntity() { return this; }

	virtual void Tick();

	virtual cmn::Vec2 Move( const cmn::Vec2& vector );

	virtual void Delete();
	virtual void Undelete();

	virtual bool Contains( const cmn::Vec2& point ) const;

	virtual void GetChildren( cmn::ICollection<IEntity*>& children ) const;
	virtual void GetParents( cmn::ICollection<IEntity*>& parents ) const;

	virtual void GetProperties( cmn::ICollection<editor_core::Property>& properties ) const;
	virtual bool TryUpdateProperty( editor_core::Property& property ) const;
	virtual bool TryUpdateFromProperty( const editor_core::Property& property );

protected:
	virtual void DrawInner( drawing::IDrawer* drawer );

private:
	cmn::Circle m_circle;

	BodyEntity* m_parentBody;
};

#endif
